package com.author.menubar;

import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;

import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.KeyStroke;

public class MenuBar extends JMenuBar {
	/* File Menu */
	private JMenu	fileMenu	= new FileMenu("File");

	/* Edit Menu */
	private JMenu	editMenu	= new EditMenu("Edit");

	/* View Menu */
	private JMenu	viewMenu	= new JMenu("View");

	/* Insert Menu */
	private JMenu	insertMenu	= new InsertMenu("Insert");

	/* Tools Menu */
	private JMenu	toolsMenu	= new JMenu("Tools");

	/* Window Menu */
	private JMenu	windowMenu	= new JMenu("Window");

	/* Help Menu */
	private JMenu	helpMenu	= new JMenu("Help");

	public MenuBar() {
		super();

		/* Add file menu */
		this.add(this.fileMenu);
		fileMenu.setMnemonic('F');

		/* Add edit menu */
		this.add(this.editMenu);
		editMenu.setMnemonic('E');

		/* Add view menu */
		this.add(this.viewMenu);
		viewMenu.setMnemonic('V');

		/* Add insert menu */
		this.add(this.insertMenu);
		insertMenu.setMnemonic('N');

		/* Add tools menu */
		this.add(this.toolsMenu);
		toolsMenu.setMnemonic('T');

		/* Add window menu */
		this.add(this.windowMenu);
		windowMenu.setMnemonic('W');

		/* Add help menu */
		this.add(this.helpMenu);
		helpMenu.setMnemonic('H');
	}

	@Override
	public void paint(Graphics g) {
		Graphics2D g2d = (Graphics2D) g;
		g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
				RenderingHints.VALUE_ANTIALIAS_ON);
		super.paint(g2d);
	}

}
